from Base.base import Base
from selenium.webdriver.common.by import By
from utils.data_header import read_yaml
import os

class Pay_page(Base):
    # 获取定位信息
    current_dir = os.path.dirname(__file__)
    test_case = read_yaml(os.path.join(current_dir, '..', 'Config', 'endpoints.yaml'))
    case = test_case[1]


    manage_loc=(By.XPATH,case['manage_loc'])
    def manage(self):
        self.click(self.manage_loc)
    productlist_loc=(By.XPATH,case['productlist_loc'])
    def productlist(self):
        self.click(self.productlist_loc)

    addproduct_loc=(By.XPATH,case['addproduct_loc'])
    def addproduct(self):
        self.click(self.addproduct_loc)

    encode_loc=(By.XPATH,case['encode_loc'])
    def encode(self,encodes):
        self.send_keys(self.encode_loc,encodes)

    name_loc=(By.XPATH,case['name_loc'])
    def name(self,names):
        self.send_keys(self.name_loc,names)
    commit_loc=(By.XPATH,case['commit_loc'])
    def commit(self):
        self.click(self.commit_loc)
    setway=(By.XPATH,case['setway'])
    def setway2(self):
        self.click(self.setway)
    setway22=(By.XPATH,case['setway2'])
    def setway222(self):
        self.click(self.setway22)

    setzfb=(By.XPATH,case['setzfb'])
    def setzfb2(self):
        self.click(self.setzfb)
    setzf=(By.XPATH,case['setzfb2'])
    def setzf1(self):
        self.click(self.setzf)
    sethl=(By.XPATH,case['sethl'])
    def sethl2(self,hl):
        self.send_keys(self.sethl,hl)
    tijiao=(By.XPATH,case['tijiao'])
    def tijiao2(self):
        self.click(self.tijiao)

    queding=(By.XPATH,case['queding'])
    def queding2(self):
        self.click(self.queding)
    shangjia=(By.XPATH,case['shangjia'])
    def shangjia2(self):
        self.click(self.shangjia)



